package com.factory;

import com.pojo.Person;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class thirdFactory {
    public Person doPerson() {
        Properties properties = new Properties();
        InputStream is = thirdFactory.class.getClassLoader().getResourceAsStream("Person.properties");
        Person person  = null;
        try {
            properties.load(is);
            String personname = properties.getProperty("person");
            person =(Person) Class.forName(personname).newInstance();


        } catch (Exception e) {
            e.printStackTrace();
        }


        return person;
    }
}
